package com.second.app.thread.线程基础.day07.线程通信.管道;

import java.io.IOException;
import java.io.PipedOutputStream;

/**
 * @Author GYZ
 * @Date 2023/11/29
 * <pre>
 *
 * </pre>
 */
public class WriteData {

    public void writeMethod(PipedOutputStream out){
        try {
            System.out.println("write :");
            for (int i=0;i<20;i++){
                String outData = ""+(i+1);
                out.write(outData.getBytes());
                System.out.println(outData);
            }
            System.out.println();
            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
